<footer>
  <?php
  if (isset($_SESSION['subjectPanel']) && isset($_SESSION['chapterPanel'])) {
    $subject = $_SESSION['subjectPanel'];
    $chapter = $_SESSION['chapterPanel'];
    echo "<p>Teacher panel (" . $subject . ": " . $chapter . ")</p>";
  } else if (isset($_SESSION['subjectPanel'])) {
    $subject = $_SESSION['subjectPanel'];
    echo "<p>Teacher panel (" . $subject . ")</p>";
  } else {
    echo "<p>Teacher panel</p>";
  }
  ?>
</footer>